<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<style type="text/css">
body, html{width: 100%;height: 100%;overflow: hidden;margin:0;}
#allmap {width:<?php if($width){echo $width;}else{echo'600';}?>px; height:<?php if($height){echo $height;}else{echo'350';}?>px; overflow: hidden;} 
</style>
<script type="text/javascript" src="http://api.map.baidu.com/api?v=1.5&ak=025811480258E7eFd9f7dbae4c060b03"></script>
<script type="text/javascript" src="http://api.map.baidu.com/library/SearchInfoWindow/1.5/src/SearchInfoWindow_min.js"></script>
<link rel="stylesheet" href="http://api.map.baidu.com/library/SearchInfoWindow/1.5/src/SearchInfoWindow_min.css" />

<title>SearchInfoWindow</title>
</head>
<body>
<div id="allmap" style="overflow:hidden;zoom:1;position:relative;">	
    <div id="map" style="height:100%;-webkit-transition: all 0.5s ease-in-out;transition: all 0.5s ease-in-out;"></div> 
</div>
 
<script type="text/javascript">
    var map = new BMap.Map('map');
    var poi = new BMap.Point(<?=$point?>); 
    map.centerAndZoom(poi, 16);
    map.enableScrollWheelZoom();

    var content = '<div style="margin:0;line-height:20px;padding:2px;">' +
                    '<img src="../img/baidu.jpg" alt="" style="float:right;zoom:1;overflow:hidden;width:100px;height:100px;margin-left:3px;"/>' +
                    '<?php echo $content;?>' +
                  '</div>';
 
    function mapgid(id){
        return document.getElementById(id);
    }
    //创建检索信息窗口对象
    var searchInfoWindow = null;
	var MapInfoOptions = {title:'<?php echo $title;?>',width:290,height:105,panel:'panel',enableAutoPan:true,enableSendToPhone: true,searchTypes:[BMAPLIB_TAB_SEARCH,BMAPLIB_TAB_TO_HERE,BMAPLIB_TAB_FROM_HERE]};
	//==========
	searchInfoWindow = new BMapLib.SearchInfoWindow(map, content, MapInfoOptions );
    var marker = new BMap.Marker(poi); //创建marker对象
    //marker.enableDragging(); //marker可拖拽
    marker.addEventListener("click", function(e){
	    searchInfoWindow.open(marker);
    })
    map.addOverlay(marker); //在地图中添加marker
    searchInfoWindow.open(marker); //在marker上打开检索信息串口
    mapgid("close").onclick = function(){
        searchInfoWindow.close();
    }
    mapgid("open").onclick = function(){
 
		searchInfoWindow = new BMapLib.SearchInfoWindow(map, content,  MapInfoOptions);
        if (mapgid("enableAutoPan").checked) {
            searchInfoWindow.enableAutoPan();
        } else {
            searchInfoWindow.disableAutoPan();
        };
        searchInfoWindow.open(marker);
    }

 
</script>
</body>
</html>